package com.enzo.prms.common.context;

import java.io.Serializable;
import java.util.Hashtable;

/**
 * @author prms1.0
 * 
 * @date:2012-5-15 ����05:02:05
 * @version :
 * 
 */
public class AppliesContext implements Serializable {

	private static final long serialVersionUID = -4707057243486674727L;
	// Specify the last update timestamp column of table
	public static final String FW_LAST_UPDATE_TS = "FW_LAST_UPDATE_TS";

	// Specify the last update user of table
	public static final String FW_LAST_UPDATE_BY = "FW_LAST_UPDATE_BY";

	private Hashtable<String, Object> table = new Hashtable<String, Object>();

	/**
	 * Stores an attribute in this <code>AppliesContext</code>.
	 * <code>null</code> values are ignored.
	 * 
	 * @param key
	 *            the attribute key
	 * @param value
	 *            the <code>Object</code> to be stored
	 */
	public void setAttribute(String key, Object value) {
		if (value != null) {
			table.put(key, value);
		}
	}
	
	/**
     * Return the value of the attribute as an <code>Object</code>, or <code>null</code> if no attribute of
     * the given key exist.
     *
     * @param key   the attribute key
     * @return an <code>Object</code> which is the value of the attribute, or <code>null</code> if the attribute
     *         does not exist.
     */
    public Object getAttribute(String key) {
        return table.get(key);
    }

}
